﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Controls_Report : System.Web.UI.UserControl
{
    public LanguageManage Language;
    public PlatformAdapter platformAdap;
    public List<BookEntity> listBook { set; get; }
    public CategoryEntity cate { set; get; }
    public long reportid = 1;
    protected void Page_Load(object sender, EventArgs e)
    {
        Language = new LanguageManage();
    }
    public string ConvertActive(bool active)
    {
        try
        {
            if (active)
            {
                return "YES";
            }
            else
            {
                return "NO";
            }
        }
        catch (Exception)
        {

            return "NO";
        }
    }
    public string ConvertPlatform(List<BookDetailEntity> details)
    {
        string platforms = "";
        platformAdap=new PlatformAdapter();
        for (int i = 0; i < details.Count; i++)
        {
            if (i < details.Count - 1)
            {
                platforms += platformAdap.GetPlatformByID((long)details[i].PlatformID)[0].Name + ", ";
            }
            else
            {
                platforms += platformAdap.GetPlatformByID((long)details[i].PlatformID)[0].Name.ToString();
            }

        }        
        return platforms;
    }

}
